package com.example.eureka_server.controller;

import com.example.eureka_server.model.Product;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * ClassName: ProductController
 * Package: com.example.eureka_server.controller
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-06-11
 * Time: 16:15
 */

@RestController
public class ProductController {


    @RequestMapping("/product/list")
    public List<Product> getList(){
        Product product1 = new Product("苹果1",20,100);
        Product product2 = new Product("香蕉1",30,200);
        Product product3 = new Product("橘子1",40,300);

        return Arrays.asList(product1,product2,product3);
    }

}
